package cm.hyb.Controller.converter;

import org.springframework.web.bind.annotation.ControllerAdvice;

@ControllerAdvice
public class ErrorHandler {
	
//	@ExceptionHandler(Exception.class)
//	@ResponseBody
//	public Object handerAll(Exception e) {
//		return "别睡了，程序出了问题，赶紧过来敲代码了！";
//		
//	}
//	
//	//如果同时出现两个异常处理，只会处理更具体的
////	@ExceptionHandler(NullPointerException.class)
////	@ResponseBody
////	public Object handerNullPointer(Exception e) {
////		return "小问题而已，别慌，我接着睡了！";
////		
////	}
//	
//	@ExceptionHandler(NullPointerException.class)
//	public String handerNullPointer(Exception e,Model model) {  //因为有@ControllerAdvice的注解，所以只能用Model
//		model.addAttribute("e", e);
//		return "error/null";
//		
//	}
}
